package com.bkaka.service.impl;

import com.bkaka.dao.ExamAnswerHistoryDao;
import com.bkaka.entity.ExamAnswerHistory;
import com.bkaka.service.ExamAnswerHistoryServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by maxiaoqiang on 2018/9/19.
 */
@Service
public class ExamAnswerHistoryServerImpl implements ExamAnswerHistoryServer {

    @Autowired
    private ExamAnswerHistoryDao historyDao;

    @Override
    public void create(ExamAnswerHistory history) {
        historyDao.create(history);
    }

    @Override
    public void update(ExamAnswerHistory history) {
        historyDao.update(history);
    }

    @Override
    public List<ExamAnswerHistory> findByPaperId(Integer examPaperId) {
        return historyDao.findByPaperId(examPaperId);
    }

    @Override
    public List<ExamAnswerHistory> countScore(Integer chapterId, Integer paperId) {
        return historyDao.countScore(chapterId, paperId);
    }

    @Override
    public ExamAnswerHistory findById(Integer id) {
        return historyDao.findById(id);
    }
}
